import 'package:flutter/material.dart';
import '../tool/public_color.dart';
import 'questionmodel.dart';
class ProblemSolvHeader extends StatelessWidget {
  const ProblemSolvHeader({super.key, required, required
    this.model, required this.dataArr, required this.keStr, required  this.chapterStr
  });
  final List<Question> dataArr;
  final Question model;
  final String keStr;
  final String chapterStr;


  @override
  Widget build(BuildContext context) {
    return builderHeader();
  }

  Container builderHeader() {
    return Container(
      color: Colors.white,
      padding: const EdgeInsets.only(top: 10, bottom: 10),
      child: Row(
        children: [
          Expanded(
            child: RichText(
                text: TextSpan(children: [
                  TextSpan(
                      text: "${model.index}",
                      style: TextStyle(
                        color: primaryColor,
                        fontSize: 14,
                      )),
                  TextSpan(
                      text: "/${dataArr.length}",
                      style: TextStyle(color: color33, fontSize: 14)),
                  TextSpan(
                      text: "  $keStr",
                      style: TextStyle(color: color66, fontSize: 14)),
                  TextSpan(text: chapterStr),
                  TextSpan(text: model.title ?? "")
                ])),
          ),
        ],
      ),
    );
  }
}
